Skip to content

Implement conversation retention, AI summaries, and file management APIs - #86

Open
sujith8875 wants to merge 1 commit into
soulpage:mainfrom
sujith8875:main
Open

Implement conversation retention, AI summaries, and file management APIs#86
sujith8875 wants to merge 1 commit into
soulpage:mainfrom
sujith8875:main

Conversation

@sujith8875

Copy link
Copy Markdown

This PR completes Tasks 1–3 by improving conversation lifecycle management, adding automatic conversation summaries, and introducing file upload APIs.

Task 1: Conversation retention and infrastructure

Added PostgreSQL configuration and required dependencies.
Added a scheduled daily cleanup job for permanently removing conversations soft-deleted for over 30 days.
Added --days and --dry-run options to the cleanup command.
Updated local CORS and cookie settings for frontend development.
Added frontend/.env to .gitignore.

Task 2: Conversation summaries

Added a summary field to conversations.
Automatically generates or refreshes summaries when conversations, messages, or versions change.
Uses GPT for concise summaries, with a local fallback when OpenAI configuration is unavailable.
Displays summaries in the Django admin.

Task 3: API development and integration

Added paginated and filterable conversation-summary endpoint:
GET /chat/conversation-summaries/
Supports page, page_size, search, title, created_after, and created_before.

Added file-management endpoints:
POST /chat/files/ — upload a file.
GET /chat/files/ — list user-uploaded files and metadata.
DELETE /chat/files// — delete an uploaded file.

Added SHA-256 duplicate detection per user, including database-level protection against simultaneous duplicate uploads.

Added media storage configuration and migrations for uploaded files.

Added tests covering summary filtering/pagination, uploads, duplicate prevention, deletion, and authorization.

email: sujithkumar.nani@gmail.com
name: suijth kumar naru
contact: +916281766782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant